/*
* @Author: jingyu.ma
* @Date:   2017-07-09 16:26:12
* @Last Modified by:   jingyu.ma
* @Last Modified time: 2017-08-09 20:51:19
*/

export const getParams = (params) => {
    let paramsList = '';
    for(let key in params){
        paramsList += paramsList? '&'+key+'='+ params[key] : key+'='+ params[key];
    }
    return paramsList
}

//获取页面的url参数
export const  getQueryString = (url,name) => {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = url.substr(1).match(reg);
    if (r !== null) return unescape(decodeURI(r[2])); return null;
};